import React from 'react'
import './index.css'
import {Button, notification} from 'antd';

/**
 * @author: RenLishisan
 * @description: 发布按钮组件，目前尚未添加发布功能，只有一个简单的弹窗通知
 * @param:
 * @return:
 * @time: 2020/10/30
 **/
class Submit extends React.Component {
    close = () => {
        console.log(
            'Notification was closed. Either the close button was clicked or duration time elapsed.',
        );
    };
    openNotification = () => {
        const key = `open${Date.now()}`;
        const btn = (
            <Button type="primary" size="small" onClick={() => notification.close(key)}>
                Confirm
            </Button>
        );
        notification.open({
            message: '发布通知：',
            description:
                '当前还尚未添加发布功能，如果你对此项目感兴趣欢迎克隆本仓库的代码来一起完善该项目！',
            btn,
            key,
            // onClose: close,
        });
    };

    render() {
        return (
            <Button className='submit-button' type="primary" onClick={this.openNotification}>
                点击发布
            </Button>
        );
    }
}

export default Submit